<template>
  <div>
    <home-header></home-header>
    <home-icons :list="iconsList"></home-icons>
    <home-swiper :list="swiperList"></home-swiper>
    <home-tag></home-tag>
    <restaurant :list="restaurantsList"></restaurant>
    <Tabber></Tabber>
  </div>
</template>

<script>
  import HomeHeader from './component/header'
  import HomeIcons from './component/icons'
  import HomeSwiper from './component/swiper'
  import HomeTag from './component/tag'
  import Restaurant from './component/restaurant'
  import Tabber from '../tabber/tabber'
  export default {
    name: 'Home',
    components: {
      HomeHeader,
      HomeIcons,
      HomeSwiper,
      HomeTag,
      Restaurant,
      Tabber
    },
    data () {
      return {
        swiperList: [],
        iconsList: [],
        recommedList: [],
        hotList: [],
        weekList: [],
        restaurantsList: [],
        activesList: []
      }
    },
    mounted () {
      this.getHomeInfo()
    },
    methods: {
      getHomeInfo () {
        this.$http.get('/static/message/index.json').then(this.getHomeInfoSucc)
      },
      getHomeInfoSucc (res) {
        var body = res.data
        if (body.ret && body.data) {
          this.swiperList = body.data.swiperList
          this.iconsList = body.data.iconsList
          this.recommedList = body.data.recommedList
          this.hotList = body.data.hotList
          this.weekList = body.data.weekList
          this.restaurantsList = body.data.restaurantsList
        }
      }
    }
  }
</script>

<style scoped lang="stylus" type="text/stylus">

</style>
